Skip to content

test(direct_imap): always pass mark_seen=False to fetch() - #8685

Merged
link2xt merged 2 commits into
mainfrom
link2xt/imap_tools-mark_seen-false
Sep 17, 2026
Merged

link2xt merged 2 commits into
mainfrom
link2xt/imap_tools-mark_seen-false

Conversation

@link2xt

@link2xt link2xt commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

mark_seen=True is the default and translates to fetching BODY of the message. mark_seen=False translates to fetching BODY.PEEK that is described in IETF RFC 3501 as "An alternate form of BODY[<section>] that does not implicitly set the \Seen flag."

It is unexpected unless you know this detail of IMAP protocol already,
but this is not going to be fixed in imap_tools: ikvk/imap_tools#179

@link2xt
link2xt force-pushed the link2xt/imap_tools-mark_seen-false branch 2 times, most recently from d44d173 to da43e24 Compare September 13, 2026 22:27
@link2xt
link2xt marked this pull request as ready for review September 13, 2026 22:43
Comment thread deltachat-rpc-client/tests/conftest.py Outdated
# fetch latest messages before starting idle so that it only
# returns messages that arrive anew
self.direct_imap.conn.fetch("1:*")
self.direct_imap.conn.fetch("1:*", mark_seen=False)

@hpk42 hpk42 Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was already, and still is a NO-OP, as fetch returns an iterator.
Probably we don't need this line or the comment at all.

@link2xt link2xt Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i think this was copied from python/, there it was possibly for the case when we reused mailboxes to mark all messages that remained from previous tests as non-recent or as \Seen.

Removed it here and in python/ too.

@hpk42 hpk42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine but i'd remove the commented line+docs.

This code is likely from the time when we reused mailboxes
in python/ tests, it does not do anything anymore.
mark_seen=True is the default and translates to fetching BODY
of the message. mark_seen=False translates to fetching BODY.PEEK
that is described in IETF RFC 3501 as
"An alternate form of BODY[<section>] that does not implicitly set the \Seen flag."

It is unexpected unless you know this detail of IMAP protocol already,
but this is not going to be fixed in imap_tools: <ikvk/imap_tools#179>
@link2xt
link2xt force-pushed the link2xt/imap_tools-mark_seen-false branch from da43e24 to ac8e911 Compare September 17, 2026 11:52
@link2xt
link2xt enabled auto-merge (rebase) September 17, 2026 13:52
@link2xt
link2xt merged commit 44c2feb into main Sep 17, 2026
54 of 55 checks passed
@link2xt
link2xt deleted the link2xt/imap_tools-mark_seen-false branch September 17, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants